<template>
  <div class="container">
      <list-table-new v-bind="tableSetting" ref="klTable"></list-table-new>
  </div>
</template>

<script>
/**
 * 用于选择标准的关联页面
 */
import {queryExperimentList} from "@/api/standardManagement/operateStandard.js";
export default {
  props:["typeId"],
  data() {
    return {
      tableSetting: {
        radioShow:true,
        showFilterBtn: false,
        showCustomBtn: false,
        searchObj: {
          searchMethod: (params, sortStr) => {
              this.getTableData(params, sortStr);
          },
          queryData: {
            page: 1,
            pageSize: 15,
          },
          searchArr: [
            {
              type: "input",
              label: "标题",
              model: "name",
              placeholder: "请输入",
            },
          ],
        },
        actionList: [],
        column: [
          {
            label: "编号",
            prop: "code",
          },
          {
            label: "标题",
            prop: "name",
          },
          {
            label: "创建人",
            prop: "createByName",
          },
          {
            label: "创建时间",
            prop: "createTime",
          },
        ],
        //表格方法
        tableMethods: {
          //点击行的方法
          rowClick: (row) => {
            //this.goDetailPage(row, "normalMaintenanceStandardDetails", "detail");
          },
        },
      },
    };
  },
  created() {

  },
  mounted() {
    this.updateData();
  },
  methods: {
    //更新列表页的数据
    updateData() {
      this.$refs.klTable.searchData();
    },
    // 获取表格数据
    getTableData(params, sortStr) {
      let queryData = Object.assign({}, params);
      if (sortStr.length > 0) {
        queryData.orders = sortStr;
      }
      queryData.appid = this.$store.state.user.userInfo.appId;
      queryData.status = 1;
      queryData.typeId = this.typeId;
      queryExperimentList(queryData).then((res) => {
        this.$set(this.tableSetting, "tableData", res.data.records);
        this.$set(this.tableSetting, "totalNumber", res.data.total);
      });
    },
    getselectData(){
       let data = this.$refs.klTable.getRadioData();
       return data;
    }
  },
};
</script>

<style lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  background-color: white;
  display: flex;
  .class-tree {
    height: 100%;
    width: 300px;
    border-top: 10px solid #f2f3f8;
  }
  .detail-content {
    height: 100%;
    width: calc(100% - 300px);
    border-left: 10px solid #f2f3f8;
    border-top: 10px solid #f2f3f8;
    padding: 20px;
    flex: 1;
    //overflow: auto;
  }
}
</style>